<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Model</title>
</head>

<body>
<?php
    class NhomNhanVien{
        function dbconnect(){ 
  		      $con = mysql_connect("localhost","root",""); 
                mysql_select_db("dbdienthoaihdt", $con);  
    	} 
    	function HienThi(){ 
    	   $conn = new NhomNhanVien();
           $conn->dbconnect(); 
            mysql_query('SET NAMES "UTF8"');
    	    $result = mysql_query("CALL XuatDSNhomNV();");
            return $result;
    	}
        function Them($ten){
            $conn = new NhomNhanVien();
            $conn->dbconnect();
            $result = mysql_query("CALL ThemNhomNV('$ten');");
            if($result===FALSE)
                return mysql_error();
            else
                return 1;
        }
        function Xoa($ma){
            $conn = new NhomNhanVien();
            $conn->dbconnect();
            $result = mysql_query("CALL XoaNhomNV('$ma');");
            if($result===FALSE)
                return mysql_error();
            else
                return 1;
        }
    }
?>
</body>
</html>
